package org.jeecg.modules.demo.zc.controller;

import org.jeecg.modules.demo.zc.entity.Sale;
import org.jeecg.modules.demo.zc.service.SaleService;
import org.jeecg.modules.demo.zc.util.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: TODO
 * @author: scott
 * @date: 2022年03月26日 16:15
 */
@RequestMapping(value = "/sale" , produces = "application/json; charset=utf-8")
@RestController
public class SaleController {

    @Autowired
    private SaleService saleService;

    @RequestMapping("/selectAll")
    public CommonResult selectAll(){

        List<Sale> saleList = saleService.selectAll();
//        System.out.println(saleList);
        if (saleList != null){
            //System.out.println(saleList);
            return new CommonResult(200,"查询销售成功",saleList);
        }else{
            return new CommonResult(404,"未查询到数据");
        }

    }


}
